package com.tmxk.days01.szk;

public class Car {
    //颜色
    private String color;
    //品牌
    private String brand;
    //名称
    private String name;
    //价格
    private double price;

    public Car() {
    }

    public Car(String color, String brand, String name, double price) {
        this.color = color;
        this.brand = brand;
        this.name = name;
        this.price = price;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    @Override
    public String toString() {
        return "Car{" +
                "color='" + color + '\'' +
                ", brand='" + brand + '\'' +
                ", name='" + name + '\'' +
                ", price=" + price +
                '}';
    }

    /**
     * 定义一个显示机动车基本信息方法
     */
    public void showInfo(){
        System.out.println("机动车的基本信息: " + color + "色,品牌是" + brand + ",型号名称是:"+ name+ " 价格是元" + price);
    }
}
